SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Emilio Augusto Veras Ivanovich
-- Create date: 03/14/2012
-- Description:	Insert or update the on Types of Samples
-- =============================================
ALTER PROCEDURE [dbo].[PROCEDURE_TYPES_OF_SAMPLES]
	-- Add the parameters for the stored procedure here
	@ID TINYINT = 0,
	@DESCRIPTION VARCHAR(100) = NULL, 
	@IS_ACTIVE BIT = 0
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
    IF @ID = 0
		-- Insert statements for procedure here	
		INSERT INTO [SGLL].[dbo].[TYPES_OF_SAMPLES] ([DESCRIPTION], [IS_ACTIVE]) VALUES (@DESCRIPTION, @IS_ACTIVE);
    ELSE
		-- Update statements for procedure here.
		UPDATE [SGLL].[dbo].[TYPES_OF_SAMPLES] SET [DESCRIPTION] = @DESCRIPTION, [IS_ACTIVE] = @IS_ACTIVE, [UPDATED] = GETDATE() WHERE [ID] = @ID;
END
GO